#import "FourCCFormatter.h"

@implementation FourCCFormatter
- (NSString *)stringForObjectValue:(id)anObject
{

	return anObject;
}

- (BOOL)getObjectValue:(id *)anObject forString:(NSString *)string errorDescription:(NSString **)error
{
	*anObject=[NSString stringWithString:string];
	return YES;
}

- (BOOL)isPartialStringValid:(NSString *)partialString newEditingString:(NSString **)newString errorDescription:(NSString **)error
{
	if ([partialString length] <=4)
	{
		return YES;
	}
	else
	{
		*newString=[partialString stringByPaddingToLength:4 withString:@"" startingAtIndex:0];
		if (error!= NULL)
		{
			*error=@"Input length exceeded";
		}
		return NO;
	}
*newString=@"";
	return NO;
}


@end
